/*
 *  draw.h
 *  SketchMenu
 *
 *  Created by George on 4/15/09.
 *  Copyright 2009 __MyCompanyName__. All rights reserved.
 *
 */
#ifdef _OBJC_COMPILE
  #import <Foundation/Foundation.h>
#endif
#include "Menu.h"
#include "MenuButton.h"
#include <stdlib.h>
#include <iostream>
#ifdef WIN32
  #include "GL/glut.h"
#else
  #include "OpenGL/gl.h"
  #include "GLUT/glut.h"
#endif
#ifndef M_PI
  #define M_PI 3.14159265
#endif


struct point{
  float x;
  float y;
  point(){
    x=0;
    y=0;
  }
  point(const point & rhs){
    this->x = rhs.x;
    this->y = rhs.y;
  };
}; 
struct sketch_event{
  point loc;
  point tilt;
  float pressure;
  int type;
  sketch_event(){
  }
  sketch_event(const sketch_event & rhs){
    this->loc = rhs.loc;
    this->tilt = rhs.tilt;
    this->pressure = rhs.pressure;
    this->type = rhs.type;
  }
};
class SketchMenu {
private:
  Menu * topMenu;
  sketch_event last_event;
  int width;
  int height;
public:
  SketchMenu();
  void draw(void);
  void handle_sketch_event(sketch_event & s);
  void set_size(int width,int height);
  point loc_to_screen(point & loc);
};
void setColor(int id, float intensity);
void DrawMenu(Menu * menu, int ring, float x, float y, float start_r,float theta, float length);
void DrawArc(float cx, float cy, float r, float start_angle, float arc_angle, int num_segments);
void DrawArcPolygon(float cx, float cy,float z, float r1,float r2, float start_angle, float arc_angle, int num_segments);